Micron Document
๐ŸŽ–๏ธGitะฏั€ะฐ๐ŸŽ–๏ธ

Commit 2b67c5229d3349f0a6638fff12fcb0fb86dbbb2d


Parents : c783ed4
Author : James Rich <2199651+jamesarich@users.noreply.github.com>
Signature : Signature validation error
Date : 2026-07-25T20:44:33-05:00
Committer : GitHub <noreply@github.com>
Date : 2026-07-25T20:44:33-05:00

fix(car): drop CarAppService from production manifests to satisfy Play car-app review (#6438)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

Changes
Diff

diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts
index 8f4591f6d3..a37cd0e2ef 100644
--- a/androidApp/build.gradle.kts
+++ b/androidApp/build.gradle.kts
@@ -130,10 +130,6 @@ configure<ApplicationExtension> {
}
ndk { abiFilters += listOf("armeabi-v7a", "arm64-v8a") }
- // Activates the (google-only) CarAppService. Off by default so production builds ship
- // notification-only car messaging; flipped on by -PenableCarTemplates=true for Closed tracks.
- manifestPlaceholders["carTemplatesEnabled"] = enableCarTemplates.toString()
-
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

diff --git a/feature/car/build.gradle.kts b/feature/car/build.gradle.kts
index a9d9fb429a..d43cc989cd 100644
--- a/feature/car/build.gradle.kts
+++ b/feature/car/build.gradle.kts
@@ -32,17 +32,21 @@ android {
defaultConfig {
minSdk = 23
consumerProguardFiles("proguard-rules.pro")
- // The CarAppService is disabled unless -PenableCarTemplates=true. feature:car resolves the
- // placeholder in its OWN manifest, so it must read the property directly (the app's value does
- // not override a library's own placeholder). Default false โ†’ production ships it disabled.
- manifestPlaceholders["carTemplatesEnabled"] =
- providers.gradleProperty("enableCarTemplates").map { it.toBoolean() }.getOrElse(false).toString()
}
// Robolectric provides the Android context that androidx.car.app TestCarContext/ScreenController need.
testOptions { unitTests { isIncludeAndroidResources = true } }
}
+// Production manifests must not contain the CarAppService AT ALL (a disabled service still
+// triggers Play's static car-app category review โ€” see the manifest comments), so the service
+// lives in an overlay manifest merged in only for -PenableCarTemplates=true builds.
+if (providers.gradleProperty("enableCarTemplates").map { it.toBoolean() }.getOrElse(false)) {
+ androidComponents {
+ onVariants { variant -> variant.sources.manifests.addStaticManifestFile("src/templates/AndroidManifest.xml") }
+ }
+}
+
dependencies {
implementation(projects.core.common)
implementation(projects.core.data)

diff --git a/feature/car/src/main/AndroidManifest.xml b/feature/car/src/main/AndroidManifest.xml
index 94c531ad43..4936627781 100644
--- a/feature/car/src/main/AndroidManifest.xml
+++ b/feature/car/src/main/AndroidManifest.xml
@@ -1,28 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Default (production) manifest: notification-only Android Auto messaging, no CarAppService.
+ The service must be entirely absent here โ€” not merely android:enabled="false" โ€” because Google
+ Play statically reviews any declared androidx.car.app service intent-filter and rejects
+ MESSAGING-category car apps holding location permissions ("Category not permitted", see the
+ v2.8.0-open.2 / versionCode 29321638 rejection, 2026-07-25). The templated service lives in
+ src/templates/AndroidManifest.xml, selected by -PenableCarTemplates=true for Internal/Closed.
+-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application>
- <!-- enabled is gated by the app's `carTemplatesEnabled` manifest placeholder: off by default
- (production ships notification-only car messaging), on for -PenableCarTemplates=true builds.
- The decisive gate is automotive_app_desc's <uses name="template" /> (see res/xml); this is
- defense-in-depth so the templated service can't be bound in production. -->
- <service
- android:name="org.meshtastic.feature.car.service.MeshtasticCarAppService"
- android:enabled="${carTemplatesEnabled}"
- android:exported="true"
- android:permission="androidx.car.app.CarAppService">
- <intent-filter>
- <action android:name="androidx.car.app.CarAppService" />
- <category android:name="androidx.car.app.category.MESSAGING" />
- </intent-filter>
- </service>
-
- <meta-data
- android:name="androidx.car.app.minCarApiLevel"
- android:value="7" />
-
- <!-- Required for Android Auto to surface MessagingStyle notifications and recognize the
- template app. Without this the automotive_app_desc declarations never reach the host. -->
+ <!-- Required for Android Auto to surface MessagingStyle notifications. -->
<meta-data
android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" />

diff --git a/feature/car/src/templates/AndroidManifest.xml b/feature/car/src/templates/AndroidManifest.xml
new file mode 100644
index 0000000000..0f66b18c9d
--- /dev/null
+++ b/feature/car/src/templates/AndroidManifest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Templated-build manifest, selected in build.gradle.kts ONLY when -PenableCarTemplates=true
+ (Internal/Closed tracks). Production builds use src/main/AndroidManifest.xml, which must NOT
+ declare a CarAppService: Google Play statically reviews any declared androidx.car.app service
+ intent-filter โ€” even one with android:enabled="false" โ€” and rejects MESSAGING-category car apps
+ that hold location permissions ("Category not permitted", see v2.8.0-open.2 / versionCode
+ 29321638 rejection, 2026-07-25).
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android">
+
+ <application>
+ <service
+ android:name="org.meshtastic.feature.car.service.MeshtasticCarAppService"
+ android:exported="true"
+ android:permission="androidx.car.app.CarAppService">
+ <intent-filter>
+ <action android:name="androidx.car.app.CarAppService" />
+ <category android:name="androidx.car.app.category.MESSAGING" />
+ </intent-filter>
+ </service>
+
+ <meta-data
+ android:name="androidx.car.app.minCarApiLevel"
+ android:value="7" />
+
+ <!-- Required for Android Auto to surface MessagingStyle notifications and recognize the
+ template app. Without this the automotive_app_desc declarations never reach the host. -->
+ <meta-data
+ android:name="com.google.android.gms.car.application"
+ android:resource="@xml/automotive_app_desc" />
+ </application>
+</manifest>

Served by rngit 1.5.2 - Generated in 0.19s